import React from 'react';
import { observer } from 'mobx-react';
import { WeaTimePicker } from 'ecCom';

interface Props {
    editable?: boolean;
    value?: string;
    valueSpan?:string;
    onChange: (string) => void;
    column?;
    row?;
}

export default observer((props: Props) => {
    const { column, row,value } = props;
    let hide=column&&column.isHide&&column.isHide(row);
    return (
        <div style={hide?{display:"none"}:{display:"block"}}>
        {props.editable ? 
        <WeaTimePicker noInput
        value={value}
        onChange={v=>{props.onChange&&props.onChange(v);column.onChange&&column.onChange(v,row)}}
    />
            : <span>{value}</span>}
        </div>
    )
});